package com.tjvib.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.tjvib.R;
import com.tjvib.bean.IndexDataBean;

import java.util.List;

public class IndexDataAdapter extends BaseQuickAdapter<IndexDataBean, BaseViewHolder> {
    public IndexDataAdapter(int layoutResId) {
        super(layoutResId);
    }

    public IndexDataAdapter(int layoutResId, @Nullable List<IndexDataBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, IndexDataBean indexDataBean) {
        baseViewHolder.setText(R.id.item_index_tv_index, indexDataBean.getIndex())
                .setText(R.id.item_index_tv_max, "" + indexDataBean.getMax())
                .setText(R.id.item_index_tv_min, "" + indexDataBean.getMin())
                .setText(R.id.item_index_tv_rms, "" + indexDataBean.getRms());
    }
}
